﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/**
 * 宝石类
 */
public class Gem : MonoBehaviour
{
    public int value = 1;
    // Start is called before the first frame update
    void Start()
    {
        BoxCollider boxc = gameObject.AddComponent<BoxCollider>();
        boxc.isTrigger = true;
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.GetComponent<PlayerControl>())
        {
            GameObject.Find("GameControllor").SendMessage("GetGem",value,0);
            Destroy(gameObject);
        }
    }
}
